/**
 * Created by weng on 2018/2/3.
 */
const superagent = require('superagent');
const request = require('request');
const axios = require('axios')
	var info = '雪屋是哪个种族的传统住所';
	 var url = 'http://www.baidu.com/s?wd=' + encodeURI(info) + '&rn=50&time='+ new Date().getTime();
    var options = {
     url:url,
      headers: {
        'Content-Type': 'text/html;charset=utf-8',
		'Connection': 'Keep-Alive',
		'Vary': 'Accept-Encoding',
		'Set-Cookie': 'BAIDUID=3AFB4CAF90A6BC9A91BB73AF6564E82D:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com',
		'Set-Cookie': 'BIDUPSID=3AFB4CAF90A6BC9A91BB73AF6564E82D; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com',
		'Set-Cookie': 'PSTM=1517667239; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com',
		'Set-Cookie': 'BD_CK_SAM=1;path=/',
		'Set-Cookie': 'PSINO=1; domain=.baidu.com; path=/',
		'Set-Cookie': 'BDSVRTM=159; path=/',
		'Set-Cookie': 'H_PS_PSSID=1469_21122; path=/; domain=.baidu.com',
		'P3P': 'CP=" OTI DSP COR IVA OUR IND COM "',
		'Cache-Control': 'private',
		'Cxy_all': 'baidu+739ad3cbd4b2babe17c630469dfd5745',
		'Cxy_ex': '1517667239+3801902119+d41d8cd98f00b204e9800998ecf8427e',
		'X-Powered-By': 'HPHP',
		'Server': 'BWS/1.1',
		'X-UA-Compatible': 'IE=Edge,chrome,=1',
		'BDPAGETYPE': 3,
		'BDQID': '0xbf823dd20000b9bf',
		'BDUSERID': 0,
      },
    };
	




console.log(url)
superagent
  .get(url)
   .set(
   {
   'X-UA-Compatible': 'IE=edge,chrome=1',
   'content-type': 'application/x-www-form-urlencoded',
   'always': 'referrer',
   
   })
  .end(function(err, res){
    // console.log("res is", res);
  });

request.get(options,function (error,info) {
  console.log("ddddddd",info);
})

axios.get(encodeURI(url))